import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import config from './config';
import { Area } from './entity/area.entity';
import { UserArea } from './entity/user-area.entity';
import { User } from './entity/user.entity';
import { WeatherInfo } from './entity/weather-info.entity';
import { RedisModule } from './util/redis/redis.module';
@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: 'mysql',
      ...config.mysql,
      synchronize: true,
      entities: ['dist/entity/*.entity.js'],
      logging: true,
    }),
    TypeOrmModule.forFeature([User, Area, WeatherInfo, UserArea]),
    RedisModule
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule { }
